package com.lemon.cloud.mp.feign;

import com.lemon.cloud.comm.model.ResultMsg;
import com.lemon.cloud.comm.po.SocialParams;
import com.lemon.cloud.comm.po.SocialUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import static com.lemon.cloud.comm.constants.OAuth2Constant.*;

@FeignClient(value = "mp-service", contextId = "mp")
public interface MpFeign{

    /**
     * 获取accessToken
     *
     * @param params
     * @return
     */
    @PostMapping(value = "/auth/getSocialUser", headers = {FROM + EQUAL + FROM_IN})
    ResultMsg<SocialUser> getSocialUser(@RequestBody(required = false) SocialParams params);

    @PostMapping(value = "/auth/getSocialUserByOpenId", headers = {FROM + EQUAL + FROM_IN})
    ResultMsg<SocialUser> getSocialUserByOpenId(@RequestParam(required = false,value = "providerUserId") String providerUserId);
}
